package com.zhangfb95.crosschain.plugin.container.java.fabric2.infra.util;

import java.io.Closeable;
import java.io.IOException;

public class CloseUtil {

    /**
     * 静默关闭资源
     *
     * @param x 被关闭资源对象
     */
    public static void closeQuietly(Closeable x) {
        if (x == null) {
            return;
        }
        try {
            x.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
